package orm

import (
	"embed"
	"go-quick/interface/ilogger"
	"go-quick/interface/iorm"
	"sync"
	"time"
)

type (
	QuickOrmEngine struct {
		SkipDefaultTransaction bool
		// NamingStrategy tables, columns naming strategy
		//NamingStrategy schema.Namer
		// FullSaveAssociations full save associations
		FullSaveAssociations bool
		// NowFunc the function to be used when creating a new timestamp
		NowFunc func() time.Time
		// DryRun generate sql without execute
		DryRun bool
		// PrepareStmt executes the given query in cached statement
		PrepareStmt bool
		// DisableAutomaticPing
		DisableAutomaticPing bool
		// DisableForeignKeyConstraintWhenMigrating
		DisableForeignKeyConstraintWhenMigrating bool
		// IgnoreRelationshipsWhenMigrating
		IgnoreRelationshipsWhenMigrating bool
		// DisableNestedTransaction disable nested transaction
		DisableNestedTransaction bool
		// AllowGlobalUpdate allow global update
		AllowGlobalUpdate bool
		// QueryFields executes the SQL query with all fields of the table
		QueryFields bool
		// CreateBatchSize default create batch size
		CreateBatchSize int
		// TranslateError enabling error translation
		TranslateError bool
		// ConnPool db conn pool
		ConnPool iorm.IConnPool
		// Dialector database dialector
		iorm.IDialector
		// Plugins registered plugins
		Plugins map[string]iorm.IPlugin

		cacheStore *sync.Map
		MapperFs   embed.FS

		SlowThreshold             time.Duration   // 慢SQL阈值
		IgnoreRecordNotFoundError bool            // 是否忽略记录没有找到错误
		log                       ilogger.ILogger // 日志
	}
)
